<template>
  <div class="bg-white">
    <el-table :data="tableData" style="width: 100%">
      <el-table-column fixed prop="date" label="Date" width="150"/>
      <el-table-column prop="name" label="Name" width="120"/>
      <el-table-column prop="state" label="State" width="120"/>
      <el-table-column prop="city" label="City" width="120"/>
      <el-table-column prop="address" label="Address"/>
      <el-table-column prop="zip" label="Zip" width="120"/>
      <el-table-column fixed="right" label="Operations" width="140">
        <template #default>
          <el-button link type="primary" size="small" @click="handleClick" text>Detail</el-button>
          <el-button link type="primary" size="small" text>Edit</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="flex justify-center mt-2">
      <el-pagination layout="total, sizes, prev, pager, next, jumper"
                     :page-sizes="[10, 20, 50]"
                     v-model:total="queryList.total"
                     v-model:current-page="queryList.start"
                     v-model:page-size="queryList.limit"/>
    </div>

  </div>
</template>

<script setup>
import { reactive, ref, watch } from 'vue'

const changeWay = (obj) => {
  console.log(obj)
}
let queryList   = reactive({
  start: 1,
  limit: 15,
  total: 10000,
})

const handleClick = () => {
  console.log('click')
}

const tableData = [
  {
    date: '2016-05-03',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
    tag: 'Home',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
    tag: 'Office',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
    tag: 'Home',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
    tag: 'Office',
  },
]
</script>
